home *** CD-ROM | disk | FTP | other *** search
- Masterclass
-
-
- Keep you Amiga waiting about and make you life easier.
-
- Recently I found myself in the situation where I really
- needed to start a program running on my Amiga even though I
- wasn't about. I was re-rendering a large animation which I
- can created with Imagine using AdPro and Fred (a must
- under-used system if ever there was one), and when it was
- finished I need to combine the results into a ANIM7 file.
-
- If you remember, ANIM7 files are like normal Amiga IFF
- animations except they are a lot faster if you have a 68020
- or better. The excellent Viewtek program comes with the
- utility MakeAnim7 which will happily take a standard file
- and process it into ANIM7 format. Anyway, the AdPro/Fred
- process was still churning away making 24 bit frames into
- HAM8 frames and doing a little post-production, and I had to
- nip home for tea. I knew the process would finish in an hour
- or so, but I couldn't wait around to start the MakeAnim7
- program. And although the Amiga is multitasking, I couldn't
- start the MakeAnim7 going because it needed to use the files
- which wouldn't exist until the AdPro/Fred process was
- complete.
-
- I needed a way of delaying starting the MakeAnim7 program
- for a few hours, so that when I came in to the office next
- morning the files would be waiting for me.
-
- That's when I remember the AmigaDOS "wait" command. Wait
- does exactly what you would expect it to: nothing. It simply
- sits there doing nothing (not wasting processor power) until
- it gets bored. You can therefore use it to delay a process
- for starting. Open a Shell and enter:
-
- wait 10 secs
-
- and you'll see that wait well, waits. You can also use the
- following format
-
- wait 1 min 10 secs
-
- for waiting longer times.
-
- Therefore, you could write a script which looked like the
- following. Remember a script is nothing more complicated
- than a text file, created with ED or some other text editor.
-
- wait 120 min
- makeanim7 hd3:house.anim
-
-
- Now with this script saved to disk under the name "Zzz" I
- could open a shell and enter:
-
- execute Zzz
-
- and then nip home for tea. When two hours had passed the
- script would move unto the MakeAnim7 part, by which time
- AdPro/Fred would be finished.
-
- You can also ask wait to keep waiting until a specific time.
- For example, enter "date" into the shell and make a note of
- the time. Quickly add a few seconds and enter:
-
- wait until 16:12
-
- or whatever the time is. The process will freeze until the
- time passes. Note that this is startlingly accurate, but it
- is certainly good enough for simply delaying the process.
-
- This got me thinking, because sometimes I get a bit wary
- about leaving the Amiga working all night on something
- important. If something has gone wrong, I would like to know
- about it. The problem is that the Amiga is in an office
- several miles away, and I don't want to keep driving there
- to look through the window.
-
- Well, thanks to modern technology I don't have to any more.
- My Amiga happens to have a modem attached to it, and by
- using ARexx to control a comms program, I can write a
- program which actually dials up my home number. Now you need
- to be really careful debugging programs like this: and one
- of the first things to check is that it will dial the right
- number every single time. The second thing is to check that
- the modem will be correctly disconnected without leaving the
- line off the hook.
-
- The set-up is something like this: an AmigaDOS script waits
- until a certain time. It then runs an ARexx program. The
- ARexx program does a little work to calculate the last image
- rendered, or how much free disk space is free: something
- that lets me know all is OK. It then uses the ARexx port on
- the terminal emulator program "Term", and instructs it to
- dial my house. The script checks for an engaged tone, and
- also checks that the line doesn't keep ringing indefinitely.
-
- This is where things start to go wrong however, as try as I
- might, I really can't understand a modem talking to me at
- V34 28,800 bps. The original plan was to connect some form
- of speech synthesiser, perhaps using the old Workbench 1.3
- Amiga SAY command. This could therefore ring me up at 10
- o'clock in the evening and say "Hello master, last frame
- rendered was 1040". It could also ring me up first thing in
- the morning and tell me to get out of bed.
-
- However, connecting a speed synthesiser to the modem is
- starting to get a bit tricky. Instead the modem dials my
- number and lets it ring only once. This lets me know that
- the next call is from the computer, and I shouldn't answer
- it. The program then redials me, and depending on the number
- of rings informs me of the current status. Three rings means
- everything is ok, six means something is wrong. Get the
- idea. Best of all, as I don't answer the call I finally get
- to use BT's service for free.
-
-
- The script used to dial up my number looks something like
- this:
-
-
-
- /* Dial me up! */
-
- address term
- OPTIONS RESULTS
- Say "Wake up modem..."
- send 'atz\r\n'
- wait 'OK'
- say "Dialing..."
- send "atdt<my number hear>\r"
-
- TIMEOUT SEC 20
-
- CLEAR wait
- ADDITEM TO wait NAME 'BUSY'
- ADDITEM TO wait NAME 'RINGING'
-
- wait
-
- IF rc ~= 0 THEN
- SAY 'no text was received from modem'
- ELSE
- do
- SAY result
- say "I know the telephone is ringing or busy"
- end
-
- if result = 'BUSY' then
- do
- say "The line is busy, so exit."
- hangup
- exit
- end
-
- if result = 'RINGING' then say "I know it is ringing.."
-
- /* We can tell if the call is answered only if the
- RINGING signal does not happen again with a few seconds...
- */
-
- max_rings = 3
- rings=0
- do while (rc=0 & rings<max_rings)
- TIMEOUT SEC 5
- CLEAR wait
- ADDITEM TO wait NAME 'RINGING'
- wait
- SAY 'Still ringing..'
- rings=rings+1
- say rc
- say result
- say rings
- end
-
-
- if rings=max_rings then
- do
- say "Too long... no-one is at home!"
- say "I'm hanging up..."
- send 'atz\r'
- exit
- end
-
-
- /* Hurrah! At last! */
-
- SAY "The telephone has been answered!"
- delay 1
- say "I'm talking to me.."
- /* Add speech synth stuff here */
- delay 1
- say "Blah blah blah"
- delay 1
- say "Goodbye, Hanging up..."
-
- send 'atz\r'
- /* Make sure... */
- delay 1
- send 'atz\r'
-
- /* end */
-
-
-
- The bit about not being able to connect the speech
- synthesiser is irritating me, so I'm trying to track down a
- GVP PhonePak. The PhonePak was a remarkable ZorroII card that
- never got the attention it deserved. Even today, the
- telecoms industry is only just starting to catching up with
- this incredible card. The PhonePak could answer telephone
- calls, and store incoming messages on hard disk. It could
- even understand pulse dialing codes which meant it was fully
- interactive. With a built-in Fax machine and ARexx port
- there was little the PhonePak couldn't do.
-
- However, in the meantime, why not have a go at trying to
- automate some of your Amiga processes. If you are a Point
- off a BBS, you could use Wait to poll your BOSS whilst still
- in the BT cheap rate every morning.
-
- Keep a look out for a program called CyberCron as well. This
- utility is specially designed to run in the background, and
- keeps a list of tasks it has to launch at certain times of
- the day.
-
-
-
-
-
-
-
-
- Box out: Pretty Workbench Displays
-
- If you remember, a month or two ago I made a plea to banish
- forever the blue and greys of the standard Amiga Workbench.
- Thankfully, at lease one person heard me and Tom Pereira has
- sent in two examples of what your workbench could look like
- if you spent a bit of time re-designing it. I can recognise
- a lot of Tom's icons as available from PD libraries and from
- the Aminet collection, so don't think that you'll need to
- design the entire collection from scratch yourself.
-
- Designing your new Workbench display can be tricky. You need
- to balance the need for more colours, with the amount of
- memory they consume: especially true if you are using
- hi-resolution screens such as dblPAL or Multiscan
- Productivity. You will also find that the more bitplanes you
- use, the slower everything goes.
-
- One option, not available to all, is to fit a graphics card
- such as a PicassoII, SD64 or CyberVision. These cards remove
- the need for the Amiga display to be held in Chip Ram, and
- are designed to work in 256 colour modes very quickly
- indeed. Unfortunately, you'll need an Amiga with Zorro
- expansion slots and a spare £300 to take up this option.
-
- So, thanks to Tom for his work, and if you have a workbench
- you feel could be a inspiration to others, please send in an
- IFF.
-
-
- Image: MyWorkbench1.iff
- Image: Flowery.iff (please use this image smaller as it
- isn't as important as MyWorkBench1.iff)
- Caption: Tom Pereira's Workbench uses lots of colour and a
- cheeky backdrop to annoy passing PC owners. The Flowery
- Bench is presumably an option for fans of very unattractive
- wallpaper.
-
-